<template lang="pug">
	.input-group
		span.input-group-btn
			button.btn.btn-default(
				type='button'
				@click='value -= 1'
			) -
		input.form-control(
			v-model="value" lazy
		)
		span.input-group-btn
			button.btn.btn-default(
				type='button'
				@click='value += 1'
			) +
</template>
<script>

	module.exports = {
		props: [
			'option',
		],
		computed: {
			value: {
				get () {
					if (this.option.name === 'seed-time' && this.option.value === undefined) {
						this.option.value = this.option.default
					}

					return parseInt(this.option.value, 10)
				},
				set (val) {
					const value = parseInt(val, 10)

					if (!isNaN(value)) {
						this.option.value = value
					}
				},
			},
	
		},
	}
</script>